{include file="public/toper"/}
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">系统管理</a>
        <a href="">系统设置</a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">&#xe666;</i></a>
</div>
<div class="x-body">

    <form action="" method="post" class="layui-form" id="formc">

        <div class="layui-tab layui-tab-card">
            <ul class="layui-tab-title">
                <li class="layui-this">网站设置</li>
                <li>会员设置</li>
                <li>提现设置</li>
                <li>订单设置</li>
                <li>关于享戴</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">

                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>流程图
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['flowchart']}" name="flowchart" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>url
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>邮费
                        </label>
                        <div class="layui-input-inline">
                            <input type="number" value="{$list['postage']}" min="1" name="postage" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>归还流程
                        </label>
                        <div class="layui-input-inline" style="width: 50%;">
                            <textarea id="attention" style="height: 320px;" lay-verify="required" autocomplete="off" name="attention">{$list.attention}</textarea>
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>刮刮乐规则
                        </label>
                        <div class="layui-input-inline" style="width: 50%;">
                            <textarea id="scraping" style="height: 320px;" lay-verify="required" autocomplete="off" name="scraping">{$list.scraping}</textarea>
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>夺宝规则
                        </label>
                        <div class="layui-input-inline" style="width: 50%;">
                            <textarea id="treasure" style="height: 320px;" lay-verify="required" autocomplete="off" name="treasure">{$list.treasure}</textarea>
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>会员到期提醒
                        </label>
                        <div class="layui-input-inline">
                            <input type="number" value="{$list['member_expire']}" min="1" name="member_expire" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>天数（一天提醒一次）
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>信用积分
                        </label>
                        <div class="layui-input-inline">
                            <input type="number" value="{$list['js_integral']}" min="1" name="js_integral" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>满多少
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>抵押押金
                        </label>
                        <div class="layui-input-inline">
                            <input type="number" value="{$list['mortgage']}" min="1" name="mortgage" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>有效天数
                        </label>
                        <div class="layui-input-inline">
                            <input type="number" value="{$list['effective']}" min="1" name="effective" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>小白信用
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>提现手续费比例
                        </label>
                        <div class="layui-input-inline">
                            <input type="number" value="{$list['fee']}" name="fee" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>%
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>提现金额
                        </label>
                        <div class="layui-input-inline">
                            <input type="number" value="{$list['money_fee']}" min="1" name="money_fee" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>大于多少才能提现
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>最低手续费
                        </label>
                        <div class="layui-input-inline">
                            <input type="number" value="{$list['min_fee']}" min="1" name="min_fee" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>元
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>最高手续费
                        </label>
                        <div class="layui-input-inline">
                            <input type="number" value="{$list['max_fee']}" min="1" name="max_fee" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>元
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>缺省值X
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['x']}" name="x" required="" lay-verify="required" autocomplete="off"  class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>缺省值Y
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['y']}" name="y" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>缺省值Z
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['z']}" name="z" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>自动收货天数
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['day_time']}" name="day_time" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>天数
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>未支付取消时间
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['day_pay']}" name="day_pay" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>小时
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>金价
                        </label>
                        <div class="layui-input-inline">
                            <input type="number" value="{$list['jingjia']}" id="jj" name="jingjia" required="" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-word-aux">
                            <span class="x-red">*一口价商品</span><button class="layui-btn" id="save_yikoujia">更新价格</button>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>佣金时间
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['commission']}" name="commission" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>天数，销售订单过了这个天数后，解放冻结佣金
                        </div>
                    </div>
                </div>


                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>图片
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['img']}" name="img" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>介绍
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['introduction']}" name="introduction" autocomplete="off"  class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>名称
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['name']}" name="name" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>座机
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['telephone']}" name="telephone" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>地址
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$list['address']}" name="address" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>
                        </div>
                    </div>


                </div>


            </div>
        </div>

        <div class="layui-form-item"><label class="layui-form-label"></label>
            <button  class="layui-btn" lay-filter="formconfig" lay-submit="">提交</button>
        </div>
    </form>
</div>
<script type="text/javascript" src="/static/js/base64.js"></script>
<script>
    layui.use(['form','layer','upload','layedit','element'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer,
            upload = layui.upload;
        var layedit = layui.layedit;
        var element = layui.element;
        layedit.set({
            uploadImage: {
                url:"{:url('Upload/uploadFiles')}"//接口url
                ,type: 'post' //默认post
            }
        });
        var attention =  layedit.build('attention'); //建立编辑器
        var scraping =  layedit.build('scraping'); //建立编辑器
        var treasure =  layedit.build('treasure'); //建立编辑器

        form.on('submit(formconfig)', function(data) {
            var _form = '';
            if ($(this).attr('data-form')) {
                _form = $($(this).attr('data-form'));
            } else {
                _form = $(this).parents('form');
            }
            layedit.sync(attention)
            $('#attention').val(base64.encode($('#attention').val()));
            layedit.sync(scraping)
            $('#scraping').val(base64.encode($('#scraping').val()));
            layedit.sync(treasure)
            $('#treasure').val(base64.encode($('#treasure').val()));
            layer.msg('数据提交中...',{time:500000});
            $.ajax({
                type: "POST",
                url: "{:url('Config/add')}",
                data: _form.serialize(),
                success: function(res) {
                    if (res.code == 200) {
                        layer.msg(res.msg, {time: 1000, icon: 1});
                    } else {
                        layer.msg(res.msg, {time: 1000, icon: 2});
                    }
                }
            });
            return false;
        });

        $('#save_yikoujia').click(function () {
            layer.msg('数据更新中...',{time:500000});
            $.get("{:url('Goods/save_yikongjia')}",{jj:$('#jj').val()},function(res){
                if(res.code==200){
                    layer.msg(res.msg,{time:2000,icon:1});
                }else{
                    layer.msg(res.msg,{time:2000,icon:2});
                }
            });
        });

    });
</script>
{include file="public/footer"/}